﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin_Board.aspx.cs" Inherits="Admin_Admin_Board" %>

<%@ Register Assembly="XControl" Namespace="XControl" TagPrefix="XCL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <XCL:XGridView ID="XGridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                DataKeyNames="ID" DataSourceID="ObjectDataSource1" AllowSorting="True">
                <Columns>
                    <asp:TemplateField HeaderText="栏目" SortExpression="BoardName">
                        <edititemtemplate>
<asp:TextBox runat="server" Text='<%# Bind("BoardName") %>' id="TextBox1"></asp:TextBox>
</edititemtemplate>
                        <itemtemplate>
&nbsp;<asp:LinkButton id="LinkButton2" runat="server" Text='<%# Eval("BoardName") %>' __designer:wfdid="w19" CommandName="Select" CausesValidation="False" ToolTip='<%# Eval("Tips") %>'></asp:LinkButton>
</itemtemplate>
                        <headerstyle cssclass="TextHead" />
                        <itemstyle cssclass="TextItem" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="ParentBoardName" HeaderText="父栏目" ReadOnly="True" 
                        SortExpression="ParentID">
                        <headerstyle cssclass="TextHead" />
                        <itemstyle cssclass="TextItem" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Order" HeaderText="排序" SortExpression="Order">
                        <headerstyle cssclass="IntHead" />
                        <itemstyle cssclass="IntItem" />
                    </asp:BoundField>
                    <asp:hyperlinkfield DataNavigateUrlFields="ID" 
						DataNavigateUrlFormatString="Admin_Title.aspx?BoardID={0}" HeaderText="管理" 
						Text="管理文章"></asp:hyperlinkfield>
                    <asp:CommandField ShowDeleteButton="True" />
                </Columns>
            </XCL:XGridView>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="XCMSData.Board"
                DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}" SelectCountMethod="SelectCount"
                SelectMethod="SelectAll" TypeName="XCMSData.Board" EnablePaging="True" 
                SortParameterName="orderClause">
                <SelectParameters>
                    <asp:Parameter Name="whereClause" Type="String" />
                    <asp:Parameter Name="orderClause" Type="String" />
                    <asp:Parameter Name="selects" Type="String" />
                    <asp:Parameter DefaultValue="0" Name="startRowIndex" Type="Int32" />
                    <asp:Parameter DefaultValue="2147483647" Name="maximumRows" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <XCL:XFormView ID="XFormView1" runat="server" AutoRefreshXGridView="True" DataKeyNames="ID"
                DataSourceID="ObjectDataSource2">
                <EditItemTemplate>
                    <div id="XFormView1_Edit" class="XFormView">
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    编号：</div>
                                <div class="ItemValue">
                                    <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>'></asp:Label></div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    栏目：</div>
                                <div class="ItemValue">
                                    <asp:TextBox ID="BoardNameTextBox" runat="server" Text='<%# Bind("BoardName") %>'>
                                    </asp:TextBox></div>
                            </div>
                            <div class="Item">
                                <div class="ItemName">
                                    父栏目：</div>
                                <div class="ItemValue">
                                    &nbsp;<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True"
                                        DataSourceID="ObjectDataSource3" DataTextField="BoardName" DataValueField="ID"
                                        SelectedValue='<%# Bind("ParentID") %>'>
                                        <asp:ListItem Selected="True" Value="0">作为分类</asp:ListItem>
                                    </asp:DropDownList>&nbsp;
                                    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" OldValuesParameterFormatString="original_{0}"
                                        SelectMethod="SelectAllForParent" TypeName="XCMSData.Board">
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="XGridView1" DefaultValue="-1" Name="__ID" PropertyName="SelectedValue"
                                                Type="Int32" />
                                        </SelectParameters>
                                    </asp:ObjectDataSource>
                                </div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    排序：</div>
                                <div class="ItemValue">
                                    <XCL:NumberBox ID="OrderNumberBox" runat="server" Text='<%# Bind("Order") %>'>
                                    &nbsp;
                                    </XCL:NumberBox></div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    提示：</div>
                                <div class="ItemValue">
                                    <asp:TextBox ID="TipsTextBox" runat="server" Text='<%# Bind("Tips") %>'>
                                    </asp:TextBox></div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    备注：</div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemValue">
                                    <asp:TextBox ID="ReadmeTextBox" runat="server" Height="130px" Text='<%# Bind("Readme") %>'
                                        TextMode="MultiLine" Width="440px">
                                    </asp:TextBox></div>
                            </div>
                        </div>
                        <div class="Foot">
                            <div style="float: left">
                                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="true" CommandName="Update"
                                    Text="更新">
                                </asp:LinkButton></div>
                            <div style="width: 5px; float: left">
                            </div>
                            <div style="float: left">
                                <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="false" CommandName="Cancel"
                                    Text="取消">
                                </asp:LinkButton></div>
                        </div>
                    </div>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <div id="Div1" class="XFormView">
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    栏目：</div>
                                <div class="ItemValue">
                                    <asp:TextBox ID="BoardNameTextBox" runat="server" Text='<%# Bind("BoardName") %>'>
                                    </asp:TextBox></div>
                            </div>
                            <div class="Item">
                                <div class="ItemName">
                                    父栏目：</div>
                                <div class="ItemValue"><asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True"
                                        DataSourceID="ObjectDataSource3" DataTextField="BoardName" DataValueField="ID"
                                        SelectedValue='<%# Bind("ParentID") %>'>
                                    <asp:ListItem Selected="True" Value="0">作为分类</asp:ListItem>
                                </asp:DropDownList><asp:ObjectDataSource ID="ObjectDataSource3" runat="server" OldValuesParameterFormatString="original_{0}"
                                        SelectMethod="SelectAll" TypeName="XCMSData.Board">
                                    <SelectParameters>
                                        <asp:Parameter Name="name" Type="String" />
                                        <asp:Parameter Name="value" Type="Object" />
                                        <asp:Parameter DefaultValue="0" Name="startRowIndex" Type="Int32" />
                                        <asp:Parameter DefaultValue="50" Name="maximumRows" Type="Int32" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                                    &nbsp;</div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    排序：</div>
                                <div class="ItemValue">
                                    <XCL:NumberBox ID="OrderNumberBox" runat="server" Text='<%# Bind("Order") %>'>
                                    &nbsp;
                                    </XCL:NumberBox></div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    提示：</div>
                                <div class="ItemValue">
                                    <asp:TextBox ID="TipsTextBox" runat="server" Text='<%# Bind("Tips") %>'>
                                    </asp:TextBox></div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    备注：</div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemValue">
                                    <asp:TextBox ID="ReadmeTextBox" runat="server" Height="130px" Text='<%# Bind("Readme") %>'
                                        TextMode="MultiLine" Width="440px">
                                    </asp:TextBox></div>
                            </div>
                        </div>
                        <div class="Foot">
                            <div style="float: left">
                                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="true" CommandName="Insert"
                                    Text="插入">
                                </asp:LinkButton></div>
                            <div style="width: 5px; float: left">
                            </div>
                            <div style="float: left">
                                <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="false" CommandName="Cancel"
                                    Text="取消">
                                </asp:LinkButton></div>
                        </div>
                    </div>
                </InsertItemTemplate>
                <ItemTemplate>
                    <div id="XFormView1_Item" class="XFormView">
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    编号：</div>
                                <div class="ItemValue">
                                    <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>'></asp:Label></div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    栏目：</div>
                                <div class="ItemValue">
                                    <asp:Label ID="BoardNameLabel" runat="server" Text='<%# Bind("BoardName") %>'></asp:Label></div>
                            </div>
                            <div class="Item">
                                <div class="ItemName">
                                    父栏目：</div>
                                <div class="ItemValue">
                                    <asp:Label ID="ParentIDLabel" runat="server" Text='<%# Bind("ParentID") %>'></asp:Label></div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    排序：</div>
                                <div class="ItemValue">
                                    <asp:Label ID="OrderLabel" runat="server" Text='<%# Bind("Order") %>'></asp:Label></div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    提示：</div>
                                <div class="ItemValue">
                                    <asp:Label ID="TipsLabel" runat="server" Text='<%# Bind("Tips") %>'></asp:Label></div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemName">
                                    备注：</div>
                            </div>
                        </div>
                        <div class="Row">
                            <div class="Item">
                                <div class="ItemValue">
                                    <asp:Label ID="ReadmeLabel" runat="server" Style="word-break: break-all; min-height: 130px"
                                        Text='<%# Bind("Readme") %>' Width="440px"></asp:Label></div>
                            </div>
                        </div>
                        <div class="Foot">
                            <div style="float: left">
                                <asp:LinkButton ID="EditButton" runat="server" CausesValidation="false" CommandName="Edit"
                                    Text="编辑">
                                </asp:LinkButton></div>
                            <div style="width: 5px; float: left">
                            </div>
                            <div style="float: left">
                                <asp:LinkButton ID="NewButton" runat="server" CausesValidation="false" CommandName="New"
                                    Text="新建">
                                </asp:LinkButton></div>
                            <div style="width: 5px; float: left">
                            </div>
                            <div style="float: left">
                                <asp:LinkButton ID="CancelSelectButton" runat="server" CausesValidation="false" CommandName="CancelSelect"
                                    Text="取消">
                                </asp:LinkButton></div>
                        </div>
                    </div>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="New">新增栏目</asp:LinkButton>
                </EmptyDataTemplate>
            </XCL:XFormView>
            <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" DataObjectTypeName="XCMSData.Board"
                InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="FindByKey"
                TypeName="XCMSData.Board" UpdateMethod="Update">
                <SelectParameters>
                    <asp:ControlParameter ControlID="XGridView1" Name="__ID" PropertyName="SelectedValue"
                        Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </div>
    </form>
</body>
</html>
